package com.freewater.springboot.demo.ioc.genericdi;

import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
@Primary
public class AnimalBusiness<T extends Animal> {

    protected final List<T> animals;

    public AnimalBusiness(List<T> animals) {
        this.animals = animals;
    }

    public void doSomeBusiness() {
        System.out.println(this.animals.size() + " animals do some business");
    }
}
